package com.example.enjoylearning.network

import io.reactivex.ObservableTransformer
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 * @Author ninetailedfox
 * @Data 2022/10/30 9:23 下午
 * @ClassName NetworkScheduler
 **/
object NetworkScheduler {
    fun <T> compose():ObservableTransformer<T,T>{
        return ObservableTransformer { observable ->
            observable.subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
        }
    }
}


